package com.qububu.share.article.dto;

import com.qububu.utils.DateUtil;
import com.qububu.utils.SystemUtil;

public class MessageInfoDto {
	private String msgId;
	private String msgText;
	private String msgCreateName;
	private String msgCreateIp;
	private String msgSummaryPicUrl;
	private int msgCreateDttm;
	private String parentMsgId;
	private String userId;
	
	/**
	 *   得到文章加密的msgId, userId
	 */
	public MessageInfoDto(String msgId, String userId){
		this.msgId = msgId;
		this.userId = userId;
	}
	
	/**
	 *   得到文章未加密的msgId, userId
	 */
	public MessageInfoDto(long msgId, long userId){
		this.msgId = SystemUtil.encrypt(String.valueOf(msgId));
		this.userId = SystemUtil.encrypt(String.valueOf(userId));
	}
	
	/**
	 *   得到评论加密的msgId, userId, parentMsgId
	 */
	public MessageInfoDto(String msgId, String userId, String parentMsgId){
		this.msgId = msgId;
		this.userId = userId;
		this.parentMsgId = parentMsgId;
	}
	
	/**
	 *   得到评论未加密的msgId, userId, parentMsgId
	 */
	public MessageInfoDto(long msgId, long userId, long parentMsgId){
		this.msgId = SystemUtil.encrypt(String.valueOf(msgId));
		this.userId = SystemUtil.encrypt(String.valueOf(userId));
		this.parentMsgId = SystemUtil.encrypt(String.valueOf(parentMsgId));
	}
	
	public String getMsgId() {
		return msgId;
	}
	
	public String getMsgText() {
		return msgText;
	}
	
	public void setMsgText(String msgText) {
		this.msgText = msgText;
	}
	
	public String getMsgCreateName() {
		return msgCreateName;
	}
	public void setMsgCreateName(String msgCreateName) {
		this.msgCreateName = msgCreateName;
	}
	
	public String getMsgCreateIp() {
		return msgCreateIp;
	}
	
	public void setMsgCreateIp(String msgCreateIp) {
		this.msgCreateIp = msgCreateIp;
	}
	
	public String getMsgSummaryPicUrl() {
		return msgSummaryPicUrl;
	}
	
	public void setMsgSummaryPicUrl(String msgSummaryPicUrl) {
		this.msgSummaryPicUrl = msgSummaryPicUrl;
	}
	
	public int getMsgCreateDttm() {
		return msgCreateDttm;
	}
	
	public void setMsgCreateDttm(int msgCreateDttm) {
		this.msgCreateDttm = msgCreateDttm;
	}
	
	public String getParentMsgId() {
		return parentMsgId;
	}
	
	public String getUserId() {
		return userId;
	}
	
	/**
	 * @功能 注册时间以String格式显示, 针对跳转
	 * */
	public String showMessageDateToString() {
		return DateUtil.formatToDTTMString(msgCreateDttm);
	}
	
}
